<template>
    <el-container class="main-layout">
        <el-header>
            <div class="header-content">
                <div class="logo">AI Drawing</div>
                <el-menu
                    mode="horizontal"
                    :router="true"
                    :default-active="activeMenu"
                >
                    <el-menu-item index="/">首页</el-menu-item>
                    <el-menu-item index="/templates">模板</el-menu-item>
                    <el-menu-item index="/admin/workflows">
                        管理后台
                    </el-menu-item>
                </el-menu>
            </div>
        </el-header>
        <router-view />
    </el-container>
</template>

<script lang="ts" setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';

const route = useRoute();
const activeMenu = computed(() => route.path);
</script>

<style lang="scss" scoped>
.main-layout {
    min-height: 100vh;

    .el-header {
        background-color: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
        max-width: 1200px;
        margin: 0 auto;
    }

    .logo {
        font-size: 20px;
        font-weight: bold;
    }
}
</style> 